home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / XS943L (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.7 KB  |  49 lines

  1. package com.sun.java.swing.plaf.metal;
  2.  
  3. import com.sun.java.swing.Icon;
  4. import com.sun.java.swing.plaf.UIResource;
  5. import java.awt.Color;
  6. import java.awt.Component;
  7. import java.awt.Graphics;
  8. import java.io.Serializable;
  9.  
  10. class MetalIconFactory$InternalFrameDefaultMenuIcon implements Icon, UIResource, Serializable {
  11.    Color backgroundColor;
  12.    Color titleColor;
  13.    Color edgeColor;
  14.    Color slashColor;
  15.  
  16.    public void paintIcon(Component c, Graphics g, int x, int y) {
  17.       this.backgroundColor = MetalLookAndFeel.getWindowBackground();
  18.       this.titleColor = MetalLookAndFeel.getPrimaryControl();
  19.       this.edgeColor = MetalLookAndFeel.getPrimaryControlDarkShadow();
  20.       g.translate(x, y);
  21.       g.setColor(this.backgroundColor);
  22.       g.fillRect(0, 0, 16, 16);
  23.       g.setColor(this.titleColor);
  24.       g.fillRect(2, 2, 12, 2);
  25.       g.drawLine(2, 4, 10, 4);
  26.       g.drawLine(2, 5, 9, 5);
  27.       g.setColor(this.edgeColor);
  28.       g.drawRect(0, 0, 15, 15);
  29.       g.drawRect(1, 1, 13, 13);
  30.       g.drawLine(2, 6, 9, 6);
  31.       g.drawLine(10, 5, 10, 5);
  32.       g.drawLine(11, 4, 13, 4);
  33.       g.drawLine(4, 4, 4, 4);
  34.       g.drawLine(7, 4, 7, 4);
  35.       g.setColor(this.backgroundColor);
  36.       g.drawLine(3, 3, 3, 3);
  37.       g.drawLine(6, 3, 6, 3);
  38.       g.translate(-x, -y);
  39.    }
  40.  
  41.    public int getIconWidth() {
  42.       return 16;
  43.    }
  44.  
  45.    public int getIconHeight() {
  46.       return 16;
  47.    }
  48. }
  49.